package cn.acewill.wsh.dagger2framedemolearn.app.di

import android.app.Application
import android.content.Context
import android.content.SharedPreferences
import cn.acewill.wsh.dagger2framedemolearn.ConstantsString
import cn.acewill.wsh.dagger2framedemolearn.app.DaggerApp
import dagger.Module
import dagger.Provides

/**
 * <pre>
 * @author : zhangyong
 * e-mail : xxx@xx
 * time : 2020/01/09
 * desc :
 * version: 1.0
 * </pre>
 */
@Module
class AppModule(var application: DaggerApp) {
    @Provides
    fun provideSharedPreferences(): SharedPreferences {
        return application.getSharedPreferences(ConstantsString.SP_NAME, Context.MODE_PRIVATE)
    }

    @Provides
    fun provideApplication(): DaggerApp {
        return application
    }

    //你还可以提供更多.......
}